<?php
include 'test_header.php';

class test_db_obj_statistics extends UnitTestCase{
	
	private $db ; 

	function setUp(){
		$this->db = db_connect();

		$sql = "
CREATE TABLE IF NOT EXISTS `user_judge_statistics` (
  `username` varchar(255) NOT NULL,
  `submit_times` bigint(20) NOT NULL,
  `accepted_times` bigint(20) NOT NULL,
  `wrong_answer_times` bigint(20) NOT NULL,
  `presentation_times` bigint(20) NOT NULL,
  `compilation_error_times` bigint(20) NOT NULL,
  `time_exceeded_times` bigint(20) NOT NULL,
  `memory_exceeded_times` bigint(20) NOT NULL,
  `output_exceeded_times` bigint(20) NOT NULL,
  `runtime_error_times` bigint(20) NOT NULL,
  `compile_time_over` bigint(20) NOT NULL,
  PRIMARY KEY (`username`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
";

		$res = $this->db->query( $sql );
	}

	function tearDown(){
		
		$sql = "drop table user_judge_statistics";

		$res = $this->db->query( $sql );
	
	}

	function test_create_new_db_obj_user_judge_statistics(){
		
		$db_obj_user_judge_statistics = new db_obj_user_judge_statistics( $this->db );
	}
}
	

$test = new test_db_obj_statistics();
$test->run( new HtmlReporter() );

